package com.chenfan.process.enums;

import lombok.Getter;

/**
 * @author K
 * @date 2021/2/2
 */
@Getter
public enum EventTypeEnums {

    /**
     * 创建
     */
    CREATE(0, "创建"),
    /**
     * 审批
     */
    APPROVAL(1, "审批"),

    /**
     * 结束
     */
    FINISH(2, "结束"),
    /**
     * 驳回
     */
    REJECTED(3, "驳回");

    private Integer code;
    private String message;

    EventTypeEnums(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static String getMessage(Integer code) {
        for (EventTypeEnums eventTypeEnums : values()) {
            if (eventTypeEnums.getCode().equals(code)) {
                return eventTypeEnums.getMessage();
            }
        }
        return "";
    }
}
